<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="first.endtoend"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="21" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.VIBRATE" />
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission
        android:name="android.permission.NFC"
        android:required="true" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <uses-feature
        android:name="android.hardware.nfc.hce"
        android:required="false" />

    <!-- Permission to detect network state (Internet on or off, airplane mode on or off) -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- Permissions to use GEO location -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <!-- Permission to use external storage -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- Permission to detect when phone is started -->
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

    <!-- Permissions for GCM (Google Cloud Messaging for android) -->
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="first.endtoend.permission.C2D_MESSAGE" />

    <permission
        android:name="first.endtoend.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />
    
    <!-- android:manageSpaceActivity="first.endtoend.SplashScreenActivity" -->

    <application
        android:name="first.endtoend.MyApplication"
        android:icon="@drawable/first"
        android:allowBackup="true"
        android:label="@string/app_name"
        android:restoreNeedsApplication="true"
        android:testOnly="false"
        android:theme="@style/AppTheme" >

        <receiver
            android:name="first.endtoend.MyBroadcastReceiver"
            android:enabled="true"
            android:exported="false"
            android:label="OnBootReceiver" >
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED" />
                <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="com.google.android.gcm.GCMBroadcastReceiver"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />
                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="first.endtoend" />
            </intent-filter>
        </receiver>

        <activity
            android:name="first.endtoend.ListBeneficiariesActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.BeneficiaryDetail"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.PortfolioActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.PortfolioDetailActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.SupplyActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.ConfirmationSupplyActivity"
            android:screenOrientation="portrait" />
        <activity
            android:name="first.endtoend.TagActivity"
            android:screenOrientation="portrait" />
        <activity 
            android:name="first.endtoend.IntermediateActivity"
            android:screenOrientation="portrait"/>
        <activity
            android:name="first.endtoend.LoadDataActivity"
            android:screenOrientation="portrait" />
        <activity 
            android:name="first.endtoend.IDGoBindingActivity"
            android:screenOrientation="portrait"/>
        <activity
            android:name="first.endtoend.SplashScreenActivity"
            android:screenOrientation="portrait" >
            <intent-filter>
                <action android:name="android.nfc.action.TAG_DISCOVERED" />
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>
        </activity>
        <activity
            android:name="first.endtoend.LoginActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait" >
        </activity>

        <service
            android:name="first.endtoend.MySyncService"
            android:enabled="true"
            android:exported="false"
            android:label="MySyncService" />
        <service android:name="first.endtoend.GCMIntentService" />
        
        <activity
            android:name="first.endtoend.SetupActivity"
            android:label="@string/title_activity_setup" >
        </activity>
        <activity
            android:name="first.endtoend.PinEntryView"
            android:screenOrientation="portrait" >
        </activity>
        
        <activity
            android:name="first.endtoend.ConfigurationActivity"
            android:screenOrientation="portrait" />
      
        
        <service
            android:name="first.endtoend.EndToEndHCEService"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.BIND_NFC_SERVICE" >
            <intent-filter>
                <action android:name="android.nfc.cardemulation.action.HOST_APDU_SERVICE" />

                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>

            <meta-data
                android:name="android.nfc.cardemulation.host_apdu_service"
                android:resource="@xml/endtoend" />
        </service>
        
     </application>

</manifest>